# include <iostream>
# include <vector>

using namespace std;

class IMenu {
public:
      virtual void show() = 0;
      //virtual void setItem() = 0;
      virtual void chooseItem() = 0;
      //virtual void go() = 0;
private:
      int choosenItem;
};

class Menu: public IMenu {
public:
      Menu()
      {
            this->menuName = "Menu";
      }

      Menu(string menuName)
      {
            this->menuName = menuName;
      }
      
      void setItem(string itemName)
      {
            itemNames.push_back(itemName);
      }
      
      void show()
      {
            cout << "*** " << menuName << " ***" << endl;
            for(unsigned int i = 0; i < itemNames.size(); ++i)
            {
                  cout << i << ". " << itemNames[i] << endl;
            }
            cout << endl;
      }

      void setSubmenu(Menu* submenu)
      {
            this->submenu.push_back(submenu);
      }

      void chooseItem()
      {
            cout << "choosing:)" << endl;
      }
private:
      string menuName;
      vector <string> itemNames;
      vector <Menu*> submenu;
};
            //this->submenu[itemNumber] = submenu;

////////////////////////////
int main (void)
{
      Menu mainMenu("Main menu");
      mainMenu.setItem("Ski tour");
      mainMenu.setItem("Freeride");
      mainMenu.setItem("Freestyle");

      Menu skitourSubmenu("Ski-tour menu");
      skitourSubmenu.setItem("Majesty");
      skitourSubmenu.setItem("Kastle");
      skitourSubmenu.setItem("Atomic");
      mainMenu.setSubmenu(&skitourSubmenu);

      Menu freerideSubmenu("Freeride menu");
      freerideSubmenu.setItem("Line");
      freerideSubmenu.setItem("Fat-ypus");
      mainMenu.setSubmenu(&freerideSubmenu);
            
      Menu crosscountrySubmenu("Cross-country menu");
      crosscountrySubmenu.setItem("Fisher");
      mainMenu.setSubmenu(&crosscountrySubmenu);

      Menu downhillSubmenu("Downhill menu");
      downhillSubmenu.setItem("Head");
      downhillSubmenu.setItem("Rossignol");
      downhillSubmenu.setItem("Polsport");
      mainMenu.setSubmenu(&downhillSubmenu);
      
      mainMenu.show();
      skitourSubmenu.show();
      freerideSubmenu.show();
      crosscountrySubmenu.show();
      downhillSubmenu.show();
      
      return 0;
}
////////////////////////////
